function App() {
    // 处理键盘输入事件——React内置泛型函数
    const changeHandler: React.ChangeEventHandler<HTMLInputElement> = (e) => {
      console.log(e.target.value)
    }
    // 处理键盘输入事件——普通写法
    function changeHandlerOld(e) {
      console.log(e.target.value)
    }
    // 处理鼠标点击事件——React内置泛型函数
    const clickHandler = (
      e: React.MouseEvent<HTMLButtonElement>,
      arg1: number,
      arg2: string
    ) => {
      console.log(e.target)
      console.log(arg1);
      console.log(arg2);
    }
  
    return (
      <>
        <input type="text" onChange={changeHandler}></input>
        <input type="text" onChange={(e) => changeHandlerOld(e)}></input>
        <button onClick={(e) => clickHandler(e, 1, 'black')}>click me</button>
      </>
    )
  }
  
  export default App
  